<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>PDF预览</title>
    <script th:inline="javascript">ctx = [[${ctx}]];</script>
    <script th:inline="javascript">baseurl = [[${url}]];</script>
</head>
<body style="overflow:hidden" th:background="${ctx}+'image/bigdata/index_bg.png'">
<!--<a class="media" th:href="${url}"></a>-->
<embed id="pdf_frame" src="" type="application/pdf" width="100%">

<script th:src="${ctx}+'lib/jquery/jquery.min.js?v=2.1.4'" type="text/javascript"></script>
<!--<script th:src="${ctx}+'lib/jquery/jquery.media.js?v=0.99'" type="text/javascript"></script>-->
<script>
    $(function() {
        let weight = document.documentElement.clientWidth-10;
        let height = Math.max(document.documentElement.clientHeight,document.body.scrollHeight)-10;
        // $('a.media').media({width:weight+'px', height:height+'px'});
        document.getElementById("pdf_frame").setAttribute("src", encodeURI(encodeURI(baseurl)));
        document.getElementById("pdf_frame").height = height;
        /**
         * 页面变化调整高度
         */
        window.onresize = function(){
            document.getElementById("pdf_frame").height = Math.max(document.documentElement.clientHeight,document.body.scrollHeight)-10;
        }
    });
</script>
</body>
</html>
